package com.dsp.cart.client;

import com.dsp.cart.client.dto.InventoryDTO;
import org.dromara.hmily.annotation.Hmily;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@FeignClient(value = "inventory")
public interface InventoryClient {

    /**
     * 库存扣减.
     *
     * @param inventoryDTO 实体对象
     * @return true 成功
     */
    @RequestMapping(value = "/decrease",method = RequestMethod.POST)
    @Hmily
    Boolean decrease(@RequestBody InventoryDTO inventoryDTO);

    /**
     * 库存扣减异常.
     *
     * @param inventoryDTO 实体对象
     * @return true 成功
     */
    @RequestMapping(value = "/decreaseException",method = RequestMethod.POST)
    @Hmily
    Boolean decreaseException(@RequestBody InventoryDTO inventoryDTO);

    @RequestMapping(value = "/test",method = RequestMethod.POST)
    String test();
}
